class CodeModel {
  final String code;

  CodeModel({required this.code});

  // JSON 工厂方法
  factory CodeModel.fromJson(Map<String, dynamic> json) {
    return CodeModel(
      code: json['code'] as String,
    );
  }

  // 转换为 JSON 方法
  Map<String, dynamic> toJson() {
    return {
      'code': code,
    };
  }
}

//登录返回数据的类
class LoginResponseModel {
  final String token;
  final String refreshToken;

  LoginResponseModel({required this.token, required this.refreshToken});

  // JSON 工厂方法
  factory LoginResponseModel.fromJson(Map<String, dynamic> json) {
    return LoginResponseModel(
      token: json['token'] as String,
      refreshToken: json['refreshToken'] as String,
    );
  }

  // 转换为 JSON 方法
  Map<String, dynamic> toJson() {
    return {
      'token': token,
      'refreshToken': refreshToken,
    };
  }
}

